<template>
	<div class="analyze">
		<div class="alert">
			<div class="alert-box">
				<h2>教材册指定小考分析:</h2>
                <i class="el-icon-close close" @click="cancel"></i>
				<el-table :data="dataList" border stripe align="center" class="table" @selection-change="handleSelectionChange">
		            <el-table-column :prop="v.prop" :label="v.label" v-for="(v,index) in dataHeaderList" align="center" show-overflow-tooltip></el-table-column>
		        </el-table>
	            <!-- <el-button type="info" class="back" @click="cancel">返回</el-button> -->
			</div>
		</div>
	</div>
</template>

<script type="text/javascript">
	export default {
		props: ['params','data'],
		data () {
			return {
				dataHeaderList: [
					{
						prop: 'bjmc',
                        label: '班级'
					},
					{
						prop: 'lszwm',
                        label: '老师中文名'
					},
					{
						prop: 'lsywm',
                        label: '老师英文名'
					},
					{
						prop: 'avgScore',
                        label: '平均分'
					},
					{
						prop: 'maxScore',
                        label: '最高分'
					},
					{
						prop: 'minScore',
                        label: '最低分'
					},
					{
						prop: 'ccc',
                        label: '   <85分占比'
					}
				],
				dataList: []
			}
		},
		created () {
			console.log(this.params,this.data)
			if (this.data == 'test') {
				this.axios.get(this.$store.state.api + 'ksscore/kscjfxxz', {
					params: {
						lx:this.params.type,
						kslx: this.params.test
					}
				}).then( res => {
					console.log(res)
					this.dataList = res.data.data.list;
				})
			}else{
				this.axios.get(this.$store.state.api + 'zyscore/getZyfsfx', {
					params: {
						lx:this.params.type,
						zylx: this.params.test
					}
				}).then( res => {
					console.log(res)
					this.dataList = res.data.data.list;
				})
			}
			

			
		},
		methods: {
			cancel () {
				this.$emit('close',{type:'analyze',cancel:true})
			},
			handleSelectionChange () {

			}
		}
	}
</script>

<style lang="less" scoped>
	h2 {
		line-height: 40px;
		text-align: left;
		color:#000;
		font-weight: bold;
	}

	.cancel {
		width: 120px;
		margin-top:20px;
	}
</style>